//根据学生的成绩设置其等级grade 
//	等级设置：85－100为A，70－84为B，60－69为C，0－59为D
#include<stdio.h>
#define N 4
typedef struct student{
	char name[10];
	int score;
	char grade;
}student; 
int main(){
	void setGrade(student *p,int n);
	student stu[N]={
		{"GA05",85},{"GA03",76},{"GA02",69},{"GA04",59}
	};
	student *pr;
	pr=stu;
	setGrade(pr,N);
	for(int i=0;i<N;i++){
		printf("%s %d %c\n", stu[i].name, stu[i].score, stu[i].grade);
	}
}

void setGrade(student *p,int n){
	for(int i=0;i<n;i++){
		if(p->score>=85) p->grade='A';
		else if(p->score>=70&&p->score<85) p->grade='B';
        else if(p->score>=60&&p->score<70) p->grade='C';
        else if(p->score<60) p->grade='D';
        p++;
	}
}